package com.panku.test;

import java.util.List;

import org.junit.Before;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.panku.dao.IUserDao;
import com.panku.entity.TbfUser;

public class Client {

	public static void main(String[] args) {
		BeanFactory factory=new ClassPathXmlApplicationContext(new String[]{"spring-context.xml","spring-mvc.xml","spring-minidao.xml"});
		IUserDao userDao=(IUserDao)factory.getBean("IUserDao");
		int count=0;
		//TbfUser curUser=new TbfUser(9,"jack","Jack is my good friend~!");
		/*List<TbfUser> users=userDao.getAll();
		for (TbfUser user : users) {
			System.out.println(user.getName());
		}*/
		/*TbfUser user=userDao.getUserById(1);
		System.out.println(user.getName());*/
		/*count = userDao.insertUser(curUser, "t_bf_user");*/
		/*count=userDao.update(new TbfUser(null,"jack","jack is my foreign name"));*/
		count=userDao.deleteById(9);
		System.out.println(count);
	}
	
}
